<!-- include tpl=head_lay -->
<form method="post" class="layui-form" id="post_save" onsubmit="return $.admin_usergroup.setok();">
<!-- if $id --><input type="hidden" name="id" id="id" value="{$id}" /><!-- /if -->
<div class="layui-card">
	<div class="layui-card-header">
		{lang用户组基本信息}
	</div>
	<div class="layui-card-body">
		<!-- if $reglist -->
		<blockquote class="layui-elem-quote">
			{lang要启用【邀请码注册】和【邮箱验证注册】功能，您需要}
			<ol style="margin-left:2em">
				<li>{lang创建一个项目（假设为regcheck）}</li>
				<li>{lang项目必须绑定一个独立模块【假设为注册验证】}</li>
				<li>{lang绑定的模块里必须有字段} <span class="red">code</span> <span class="red">user_id</span> <span class="red">active_time</span>
			</ol>
		</blockquote>
		<!-- /if -->
		<div class="layui-form-item">
			<label class="layui-form-label">
				{lang名称}
			</label>
			<div class="layui-input-inline default-auto">
				<input type="text" id="title" required lay-verify="required" name="title" value="{$rs.title}" autocomplete="off" class="layui-input" />
			</div>
			<div class="layui-input-inline auto gray lh38">
				{lang设置用户组的名称}
			</div>
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label">
				{lang注册审核}
			</label>
			<div class="layui-input-inline auto">
				<input type="radio" name="register_status" lay-filter="register_status" title="{lang免审核}" value="1" {if $rs.register_status == '1'} checked{/if} />
				<input type="radio" name="register_status" lay-filter="register_status" title="{lang邮箱验证}" value="email" {if $rs.register_status == 'email'} checked{/if} />
				<input type="radio" name="register_status" lay-filter="register_status" title="{lang手机号验证}" value="mobile" {if $rs.register_status == 'mobile'} checked{/if} />
				<input type="radio" name="register_status" lay-filter="register_status" title="{lang邀请码}" value="code" {if $rs.register_status == 'code'} checked{/if} />
				<input type="radio" name="register_status" lay-filter="register_status" title="{lang人工审核}" value="0" {if !$rs.register_status} checked{/if} />
			</div>
			<div class="layui-input-inline auto gray lh38">{lang请根据您的业务需求实现不同注册方式}</div>
		</div>
		<div class="layui-form-item{if $rs.register_status != 'email' && $rs.register_status != 'mobile'} hide{/if}" id="register_status_notice">
			<label class="layui-form-label">
				{lang通知模板}
			</label>
			<div class="layui-input-block">
				<select name="tpl_id">
					<option value="">{lang请选择…}</option>
					<!-- loop from=$notice_list key=$k value=$v id=$idx -->
					<optgroup label="{$v.title}">
						<!-- loop from=$v.rslist key=$key value=$value id=$tmpid -->
						<option value="{$value.id}" {if $rs.tpl_id==$value.id} selected{/if}>{$value.title} <!-- if $value.note -->_{$value.note}<!-- /if --> / {$v.title}</option>
						<!-- /loop -->
					</optgroup>
					<!-- /loop -->
				</select>
			</div>
			<div class="layui-input-block mtop">
				{lang选择通知模板，注意邮件模板和短信模板的区别}
			</div>
		</div>

		<!-- if $reglist -->
		<div class="layui-form-item">
			<label class="layui-form-label">
				{lang验证库}
			</label>
			<div class="layui-input-block">
				<!-- loop from=$reglist key=$key value=$value -->
				<input type="radio" name="tbl_id" title="{$value.title}" value="{$value.id}"{if $rs.tbl_id == $value.id} checked{/if}>
				<!-- /loop -->
				<input type="radio" name="tbl_id" title="{lang不使用}" value="0"{if !$rs.tbl_id} checked{/if} />
			</div>
			<div class="layui-input-block mtop">{lang仅限启用验证后才有效}</div>
		</div>
		
		<!-- /if -->
		<div class="layui-form-item">
			<label class="layui-form-label">
				{lang开放选择}
			</label>
			<div class="layui-input-inline auto">
				<input type="radio" name="is_open" title="{lang禁用}" value="0"{if !$rs.is_open} checked{/if}>
				<input type="radio" name="is_open" title="{lang启用}" value="1"{if $rs.is_open} checked{/if}>
			</div>
			<div class="layui-input-inline auto gray lh38">
				{lang设置是否开放此组供用户选择（启用后允许用户自行选择用户组）}
			</div>
		</div>
		<!-- if $id && !$rs.is_guest && $all_fields_list -->
		<div class="layui-form-item">
			<label class="layui-form-label">
				{lang字段}
			</label>
			<div class="layui-input-block" id="user_fields_ul">
				<!-- loop from=$all_fields_list key=$key value=$value -->
				<input type="checkbox" name="fields_list[]" title="{$value.title}" value="{$value.identifier}"{if $fields_list && in_array($value.identifier,$fields_list)} checked{/if} />
				<!-- /loop -->
			</div>
			<div class="layui-input-block mtop">
				<div class="layui-btn-group">
					<input type="button" class="layui-btn layui-btn-sm" value="全选" onclick="$.checkbox.all('user_fields_ul');layui.form.render('checkbox')"/>
					<input type="button" class="layui-btn layui-btn-sm" value="全不选" onclick="$.checkbox.none('user_fields_ul');layui.form.render('checkbox')"/>
					<input type="button" class="layui-btn layui-btn-sm" value="反选" onclick="$.checkbox.anti('user_fields_ul');layui.form.render('checkbox')"/>
				</div>
			</div>
		</div>
		<!-- /if -->
		
		
		<div class="layui-form-item">
			<label class="layui-form-label">{lang排序}</label>
			<div class="layui-input-inline short">
				<input type="text" id="taxis" name="taxis" value="{$rs.taxis ? $rs.taxis : 255}" autocomplete="off" class="layui-input" />
			</div>
			<div class="layui-form-mid layui-word-aux">
				{lang设置排序，最大值不超过255，最小值为0，值越小越往前靠}
			</div>
		</div>
	</div>
</div>
<div class="layui-card">
	<div class="layui-card-header">
		{lang权限设置}
		<div class="layui-btn-group fr">
			<input type="button" class="layui-btn layui-btn-sm" value="全部可读" onclick="$('input[data=read]').prop('checked',true);layui.form.render('checkbox')" />
			<input type="button" class="layui-btn layui-btn-sm" value="全部不可读" onclick="$('input[data=read]').prop('checked',false);layui.form.render('checkbox')" />
		</div>
	</div>
	<div class="layui-card-body">
		<!-- loop from=$project_list key=$key value=$value -->
		<div class="layui-form-item" id="project_{$value.id}">
			<label class="layui-form-label" style="width:auto;min-width:150px;text-align: left;">{$value.space}{$value.title}</label>
			<div class="layui-input-inline default-auto">
				<div class="layui-btn-group">
					<input type="button" class="layui-btn layui-btn-sm" value="{lang全选}" onclick="$.checkbox.all('project_{$value.id}');layui.form.render('checkbox')" />
					<input type="button" class="layui-btn layui-btn-sm" value="{lang全不选}" onclick="$.checkbox.none('project_{$value.id}');layui.form.render('checkbox')" />
					<input type="button" class="layui-btn layui-btn-sm" value="{lang反选}" onclick="$.checkbox.anti('project_{$value.id}');layui.form.render('checkbox')" />
				</div>
				<input type="checkbox" name="popedom[]" data="read" title="阅读"  value="read:{$value.id}"{if $popedom_users && in_array('read:'.$value.id,$popedom_users)} checked{/if} />
				<!-- if $value.module -->
				<!-- if $value.post_status -->
				<input type="checkbox" name="popedom[]" title="发布" value="post:{$value.id}"{if $popedom_users && in_array('post:'.$value.id,$popedom_users)} checked{/if} />
				<input type="checkbox" name="popedom[]" title="发布免审核" value="post1:{$value.id}"{if $popedom_users && in_array('post1:'.$value.id,$popedom_users)} checked{/if} />
				<!-- /if -->
				<!-- if $value.comment_status -->
				<input type="checkbox" name="popedom[]" title="回复" value="reply:{$value.id}"{if $popedom_users && in_array('reply:'.$value.id,$popedom_users)} checked{/if} />
				<input type="checkbox" name="popedom[]" title="回复免审核" value="reply1:{$value.id}"{if $popedom_users && in_array('reply1:'.$value.id,$popedom_users)} checked{/if} />
				<!-- /if -->
				<!-- /if -->
			</div>
		</div>
		<!-- /loop -->
	</div>
</div>
<div class="submit-info-clear"></div>
<div class="submit-info">
	<div class="layui-container center">
		<input type="submit" value="{lang提交}" class="layui-btn layui-btn-lg layui-btn-danger" />
		<input type="button" value="{lang取消关闭}" class="layui-btn layui-btn-lg layui-btn-primary" onclick="$.admin.close()" />
	</div>
</div>
</form>
<!-- include tpl=foot_lay -->